package cn.tedu.qxhouserent.house.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@Accessors(chain = true)
public class UserUpdateInfoParam implements Serializable {

    @NotEmpty(message = "修改用户失败，请填写用户名！")
    @Pattern(regexp = "(^[a-zA-Z][a-zA-Z0-9_-]{3,15}$)", message = "修改用户失败，用户名必须是4~16个由字母、数字、下划线、减号组成的字符，且第1个字符必须是字母！")
    @ApiModelProperty(value = "用户名",required = true)
    private String username;
    @NotEmpty(message = "修改用户失败，请填写密码！")
    @Pattern(regexp = "(^.{4,16}$)", message = "修改用户失败，密码必须是4~16字符！")
    @ApiModelProperty(value = "密码",required = true)
    private String password;
    @NotEmpty(message = "修改用户失败,必须提交头像")
    @ApiModelProperty(value = "头像",required = true)
    private String avatar;
    @NotEmpty(message = "必须提交昵称")
    @ApiModelProperty(value = "昵称",required = true)
    private String nickname;
    @NotEmpty(message = "必须提交手机号码")
    @Pattern(regexp = "(^1[3-9]\\d{9}$)",
            message = "手机号格式不正确")
    @ApiModelProperty(value = "电话号码",required = true)
    private String phoneNumber;
    @NotEmpty(message = "必须提交邮箱")
    @Pattern(regexp = "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)",
            message = "添加用户失败,邮箱不正确")
    @ApiModelProperty(value = "邮箱",required = true)
    private String email;


}
